<%
    @CSSs=["lifebook.css","form.css"]
    @currentTab = "lifebook"
    @currentMenu = "home"
    
    @location = session[:user].username+" 的照片日记 - 添加"  
%>
<style>
#results{
    padding:10px;
    font-size:14px;
    font-weight:bold;
}
#progress-bar {
  width:385px;
  margin-left:10px;
  margin-bottom:20px;
  position:relative;
}
#progress-bar #status-bar {
  height:9px;
  width:0;
  background-color:#dddddd;
  border:solid 1px #666666;
  position:absolute;
}
#progress-bar #status-text {
  display:block;
  font-size:10px;
  padding-left:5px;
  padding-top:2px;
  position:absolute;
}
</style>
<script language="JavaScript">  
<!--  
function ShowSize(files)
{  
  var fso,f;  
  fso=new ActiveXObject("Scripting.FileSystemObject");  
  f=fso.GetFile(files);
  if(f.size>10*1024*1024)
  {
    fsize=f.size/(1000000);
    alert("上传的文件不能超过10M！您的文件大小是"+fsize+"M");
    return false;
  }
  else
  {
    return true;
  }
}  
//-->
</script>
<script language="JavaScript" type="text/javascript" src="/javascripts/upload_progress_javascript.js"></script>
<% @upid = Time.now.to_i.to_s %>
<%= start_form_tag({:action => 'upload',
                    :upload_id => @upid},
                   {:multipart => true, 
                    :target => 'upload',
                    :onsubmit => "UploadProgress.monitor('#{escape_javascript @upid}')"}) %>
<div id="form">
   <div id="formTitle">添加照片日记</div>
   <div id="formDesc">
   您可以上传.ZIP压缩包，这样方便上传，而且也方便管理。<A href="/lifebook_demo/index.htm">查看动画演示</a>
   <br><br><i>您的空间使用情况 已用<%=getUsedSpace%>M/共有<%=getTotalSpace%>M.</i>
   </div>
   <div id="alertPanel"></div>
   <table class="subForm" cellpadding="0" cellspacing="5">
		<tr>
			<th></th>
			<td>
                <input type="file" name="file" size="50">  
                <div id="results"></div>
                <div id="progress-bar"></div>
			</td>
		</tr>
	</table>    
	<table cellpadding="0" cellspacing="0" align="center">
		<tr>
			<td><input class="btn" name="commit" type="submit" value="上 传"/></td>
		</tr>
	</table>
</div>
<%= end_form_tag %>
<iframe id="upload" name="upload" src="about:blank" frameborder="0" width="100%" height="100"></iframe>